sip: media-pipeline: Do not set the stream properties prematurely
This commit is contained in:
@@ -384,6 +384,22 @@ initable_init (GInitable *initable,
|
|||||||
"stream-properties", props,
|
"stream-properties", props,
|
||||||
NULL);
|
NULL);
|
||||||
|
|
||||||
|
gst_structure_free (props);
|
||||||
|
}
|
||||||
|
|
||||||
|
env_var = g_getenv ("CALLS_AUDIOSRC");
|
||||||
|
if (env_var) {
|
||||||
|
self->audiosrc = gst_element_factory_make (env_var, "source");
|
||||||
|
} else {
|
||||||
|
/* could also use autoaudiosrc instead of pulsesrc */
|
||||||
|
self->audiosrc = gst_element_factory_make ("pulsesrc", "source");
|
||||||
|
|
||||||
|
/* enable echo cancellation and set buffer size to 40ms */
|
||||||
|
props = gst_structure_new ("props",
|
||||||
|
"media.role", G_TYPE_STRING, "phone",
|
||||||
|
"filter.want", G_TYPE_STRING, "echo-cancel",
|
||||||
|
NULL);
|
||||||
|
|
||||||
g_object_set (self->audiosrc,
|
g_object_set (self->audiosrc,
|
||||||
"buffer-time", (gint64) 40000,
|
"buffer-time", (gint64) 40000,
|
||||||
"stream-properties", props,
|
"stream-properties", props,
|
||||||
@@ -392,12 +408,6 @@ initable_init (GInitable *initable,
|
|||||||
gst_structure_free (props);
|
gst_structure_free (props);
|
||||||
}
|
}
|
||||||
|
|
||||||
env_var = g_getenv ("CALLS_AUDIOSRC");
|
|
||||||
if (env_var)
|
|
||||||
self->audiosrc = gst_element_factory_make (env_var, "source");
|
|
||||||
else
|
|
||||||
self->audiosrc = gst_element_factory_make ("pulsesrc", "source");
|
|
||||||
|
|
||||||
if (!self->audiosrc || !self->audiosink) {
|
if (!self->audiosrc || !self->audiosink) {
|
||||||
g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED,
|
g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED,
|
||||||
"Could not create audiosink or audiosrc");
|
"Could not create audiosink or audiosrc");
|
||||||
|
|||||||
Reference in New Issue
Block a user