From 27463212d9a56f3551cbdee361656b563f14d896 Mon Sep 17 00:00:00 2001 From: Evangelos Ribeiro Tzaras Date: Thu, 25 Nov 2021 03:31:44 +0100 Subject: [PATCH] media-codecs: Add codec availability check to public API This will be useful for building a list of preferred audio codecs. --- plugins/sip/gst-rfc3551.c | 8 +++++++- plugins/sip/gst-rfc3551.h | 1 + 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/plugins/sip/gst-rfc3551.c b/plugins/sip/gst-rfc3551.c index 634c034..cd022b4 100644 --- a/plugins/sip/gst-rfc3551.c +++ b/plugins/sip/gst-rfc3551.c @@ -39,7 +39,13 @@ static MediaCodecInfo gst_codecs[] = { }; -static gboolean +/** + * media_codec_available_in_gst: + * @codec: A #MediaCodecInfo + * + * Returns: %TRUE if codec is available on your system, %FALSE otherwise + */ +gboolean media_codec_available_in_gst (MediaCodecInfo *codec) { gboolean available = FALSE; GstRegistry *registry = gst_registry_get (); diff --git a/plugins/sip/gst-rfc3551.h b/plugins/sip/gst-rfc3551.h index 7b77ab6..8c53f15 100644 --- a/plugins/sip/gst-rfc3551.h +++ b/plugins/sip/gst-rfc3551.h @@ -44,6 +44,7 @@ typedef struct { } MediaCodecInfo; +gboolean media_codec_available_in_gst (MediaCodecInfo *codec); MediaCodecInfo* media_codec_by_name (const char *name); MediaCodecInfo* media_codec_by_payload_id (uint payload_id); gchar* media_codec_get_gst_capabilities (MediaCodecInfo *codec);