add sdp_audio_codec_is_set

Change-Id: I078efe5b42367ad1089c53f11f7eb6f3a9dd9443
This commit is contained in:
Neels Hofmeyr 2022-08-06 17:39:04 +02:00 committed by neels
parent e29ee5a4e2
commit 2d116822f3
2 changed files with 6 additions and 0 deletions

View File

@ -36,6 +36,7 @@ struct sdp_msg {
const char *sdp_msg_line_end(const char *src);
bool sdp_audio_codec_is_set(const struct sdp_audio_codec *a);
int sdp_audio_codec_cmp(const struct sdp_audio_codec *a, const struct sdp_audio_codec *b,
bool cmp_fmtp, bool cmp_payload_type);
int sdp_audio_codecs_cmp(const struct sdp_audio_codecs *a, const struct sdp_audio_codecs *b,

View File

@ -30,6 +30,11 @@
#include <osmocom/msc/debug.h>
#include <osmocom/msc/sdp_msg.h>
bool sdp_audio_codec_is_set(const struct sdp_audio_codec *a)
{
return a && a->subtype_name[0];
}
/* Compare name, rate and fmtp, returning typical cmp result: 0 on match, and -1 / 1 on mismatch.
* If cmp_fmtp is false, do *not* compare the fmtp string; if true, compare fmtp 1:1 as strings.
* If cmp_payload_type is false, do *not* compare the payload_type number.