Commit 5f9fdf7c authored by Evangelos Ribeiro Tzaras's avatar Evangelos Ribeiro Tzaras
Browse files

use codec derived capabilities

parent 594d70d4
......@@ -32,9 +32,6 @@ typedef struct {
#define RTCP_PORT_RECV_SINK 5003
#define RTCP_PORT_RECV_SRC 5007
// get this from gst-rfc3551.h
#define CAPS "application/x-rtp,media=(string)audio,clock-rate=(int)8000,encoding-name=(string)G722,payload=(int)9"
/* TODO:
* watch the gstreamer busses
* remove previously linked pads (if any) in the "pad-added" handler
......@@ -146,6 +143,7 @@ main (int argc,
GstCodec *codec = NULL;
GstPad *srcpad, *sinkpad;
GstCaps *caps;
g_autofree gchar *caps_string = NULL;
const gchar *codec_name = g_getenv ("CODEC");
const gchar *remote = g_getenv ("REMOTE");
......@@ -161,7 +159,8 @@ main (int argc,
gst_init (&argc, &argv);
g_debug ("Capabilities:\n%s", gst_codec_get_gst_capabilities (codec));
caps_string = gst_codec_get_gst_capabilities (codec);
g_debug ("Capabilities:\n%s", caps_string);
/* could also use autoaudiosink instead of pulsesink */
data.audiosink = gst_element_factory_make ("pulsesink", "sink");
......@@ -212,7 +211,7 @@ main (int argc,
gst_bin_add (GST_BIN (data.send_pipeline), data.send_rtpbin);
gst_bin_add (GST_BIN (data.recv_pipeline), data.recv_rtpbin);
caps = gst_caps_from_string (CAPS);
caps = gst_caps_from_string (caps_string);
/* set udp sinks and sources for RTP and RTCP */
/* receive/in direction */
g_object_set (data.rtp_src,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment