mirror of
https://gitlab.gnome.org/GNOME/calls.git
synced 2025-01-07 04:15:32 +00:00
sip: media: Allow specifying SRTP for GStreamer capabilities
When using SRTP the GstCaps must be set accordingly.
This commit is contained in:
parent
7ac862155b
commit
58f9f5cb62
3 changed files with 8 additions and 4 deletions
|
@ -656,7 +656,7 @@ pipeline_setup_codecs (CallsSipMediaPipeline *self,
|
|||
}
|
||||
|
||||
/* UDP src capabilities */
|
||||
caps_string = media_codec_get_gst_capabilities (codec);
|
||||
caps_string = media_codec_get_gst_capabilities (codec, FALSE);
|
||||
g_debug ("Capabilities:\n%s", caps_string);
|
||||
|
||||
caps = gst_caps_from_string (caps_string);
|
||||
|
|
|
@ -106,15 +106,18 @@ media_codec_by_payload_id (guint payload_id)
|
|||
/* media_codec_get_gst_capabilities:
|
||||
*
|
||||
* @codec: A #MediaCodecInfo
|
||||
* @use_srtp: Whether to use SRTP
|
||||
*
|
||||
* Returns: (transfer full): The capability string describing GstCaps.
|
||||
* Used for the RTP source element.
|
||||
*/
|
||||
gchar *
|
||||
media_codec_get_gst_capabilities (MediaCodecInfo *codec)
|
||||
media_codec_get_gst_capabilities (MediaCodecInfo *codec,
|
||||
gboolean use_srtp)
|
||||
{
|
||||
return g_strdup_printf ("application/x-rtp,media=(string)audio,clock-rate=(int)%u"
|
||||
return g_strdup_printf ("application/%s,media=(string)audio,clock-rate=(int)%u"
|
||||
",encoding-name=(string)%s,payload=(int)%u",
|
||||
use_srtp ? "x-srtp" : "x-rtp",
|
||||
codec->clock_rate,
|
||||
codec->name,
|
||||
codec->payload_id);
|
||||
|
|
|
@ -47,5 +47,6 @@ typedef struct {
|
|||
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);
|
||||
gchar *media_codec_get_gst_capabilities (MediaCodecInfo *codec,
|
||||
gboolean use_srtp);
|
||||
GList *media_codecs_get_candidates (void);
|
||||
|
|
Loading…
Reference in a new issue