1
0
Fork 0
mirror of https://gitlab.gnome.org/GNOME/calls.git synced 2024-11-17 07:46:03 +00:00

sip: gst-rfc3551: query for plugin availability

This commit is contained in:
Evangelos Ribeiro Tzaras 2021-04-09 00:12:37 +02:00 committed by Guido Gunther
parent a5a9f728ae
commit 2cb8139094
2 changed files with 22 additions and 7 deletions

View file

@ -22,24 +22,38 @@
*
*/
#define G_LOG_DOMAIN "CallsSipMediaManager"
#include "gst-rfc3551.h"
#include <glib.h>
#include <gst/gst.h>
/* Use the following codecs in order of preference */
static MediaCodecInfo gst_codecs[] = {
{8, "PCMA", 8000, 1, "rtppcmapay", "rtppcmadepay", "alawenc", "alawdec"},
{0, "PCMU", 8000, 1, "rtppcmupay", "rtppcmudepay", "mulawenc", "mulawdec"},
{3, "GSM", 8000, 1, "rtpgsmpay", "rtpgsmdepay", "gsmenc", "gsmdec"},
{9, "G722", 8000, 1, "rtpg722pay", "rtpg722depay", "avenc_g722", "avdec_g722"},
{4, "G723", 8000, 1, "rtpg723pay", "rtpg723depay", "avenc_g723_1", "avdec_g723_1"}, // does not seem to work
{8, "PCMA", 8000, 1, "rtppcmapay", "rtppcmadepay", "alawenc", "alawdec", "libgstalaw.so"},
{0, "PCMU", 8000, 1, "rtppcmupay", "rtppcmudepay", "mulawenc", "mulawdec", "libgstmulaw.so"},
{3, "GSM", 8000, 1, "rtpgsmpay", "rtpgsmdepay", "gsmenc", "gsmdec", "libgstgsm.so"},
{9, "G722", 8000, 1, "rtpg722pay", "rtpg722depay", "avenc_g722", "avdec_g722", "libgstlibav.so"},
{4, "G723", 8000, 1, "rtpg723pay", "rtpg723depay", "avenc_g723_1", "avdec_g723_1", "libgstlibav.so"}, // does not seem to work
};
static gboolean
media_codec_available_in_gst (MediaCodecInfo *codec) {
/* TODO probe available plugins in GStreamer */
return TRUE;
gboolean available = FALSE;
GstRegistry *registry = gst_registry_get ();
GstPlugin *plugin = NULL;
plugin = gst_registry_lookup (registry, codec->filename);
available = !!plugin;
if (plugin)
gst_object_unref (plugin);
g_debug ("Gstreamer plugin for %s %s available",
codec->name, available ? "is" : "is not");
return available;
}
MediaCodecInfo *

View file

@ -40,6 +40,7 @@ typedef struct {
char *gst_depayloader_name;
char *gst_encoder_name;
char *gst_decoder_name;
char *filename;
} MediaCodecInfo;